package com.service.lyxmservice.service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.PlatformTransactionManager;
import org.springframework.transaction.annotation.Transactional;

import com.alibaba.dubbo.config.annotation.Service;
import com.service.lyxmservice.dao.UserDao;
import com.service.lyxmservice.model.User;
import com.service.lyxmserviceapi.testInterface.TestInterface;
@Service
public class TestService implements TestInterface{
	@Autowired
	private UserDao userDao;
	@Autowired
	private TestService testService;
	@Autowired
	private PlatformTransactionManager txManager1;
	
	public String iAmtest(String a,String b){
		
		
		String c = a+b;
		Map<String,Object> map = new HashMap<String,Object>();
		map.put("name", a);
		if(""!=a){
			
		}
		
		List<User> list =userDao.findUser(a) ;
		for(User u :list){
			System.out.println("tele"+u.getTelephone());
		}
		return c;
	}

	@Override
	public String testInsert() {
		try{
			testService.testInsert1("lirongjie1");
			testService.testInsert1("lirongjie2");
		}catch(Exception e){
			e.printStackTrace();
		}
		return null;
	}
	
	@Override
	@Transactional
	public String testInsert1(String name) {
		userDao.testInsert(name, "22222");
		return "1";
	}
	
}
